//
//  BLDefineConfig.h
//  Byelone
//
//  Created by 乔小乔 on 2020/12/14.
//

#import "AppDelegate.h"

#ifndef BLDefineConfig_h
#define BLDefineConfig_h

#define BL_iPhoneX  \
({BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})

#define BLWS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

//尺寸相关宏
#define BL_WINDOW_WIDTH   [UIScreen mainScreen].bounds.size.width
#define BL_WINDOW_HEIGHT  [UIScreen mainScreen].bounds.size.height
#define BL_WINDOW_FRAME   CGRectMake(0, 0, BL_WINDOW_WIDTH, BL_WINDOW_HEIGHT)
#define BL_WINDOW [[UIApplication sharedApplication] keyWindow]

#define BL_STATUS_HEIGHT  (BL_iPhoneX ? 44.0f : 20.0f)  //状态栏
#define BL_NAV_HEIGHT     44   //导航栏
#define BL_NAVANDSTATUS_HEIGHT (BL_iPhoneX?88.0f: 64.0f)  //导航栏和状态栏高度
#define BL_BOTTOM_MARGIN  (BL_iPhoneX? 34:0)    //底部安全区域高度
#define BL_TABBAR_HEIGHT (BL_iPhoneX?83.0f: 49.0f) //tabbar加安全区域高度
#define BL_CONTENT_HEIGHT    BL_WINDOW_HEIGHT-BL_NAVANDSTATUS_HEIGHT-BL_BOTTOM_MARGIN //去除导航栏和底部安全区域后的高度
#define BL_TABCONTENT_HEIGHT    BL_WINDOW_HEIGHT-BL_NAVANDSTATUS_HEIGHT-BL_TABBAR_HEIGHT //有tabbar的页面去除导航栏和底部tabbar后的高度

#define BL_SCALE(w) (BL_WINDOW_WIDTH/375.0*(w))   //按比例取宽度
#define Hmargin_VALUE 15
#define Vmargin_VALUE 12
#define Tag_Height 23
/// 播放器view的tag，列表中UI控件唯一tag值
#define kPlayerViewTag 100

//颜色
#define BL_CELL_SEPARATORCOLOR_COLOR  [UIColor chColorWithHexString:@"#ECECEC"]
#define BL_CELL_INECOLOR [UIColor chColorWithHexString:@"#EDEDF0"]
#define BL_COLOR_PURPLE [UIColor chColorWithHexString:@"#6B71F5"]  //全局通用紫色
#define BL_COLOR_LINEPURPLE [UIColor chColorWithHexString:@"#F0F0FF"]  //全局通用浅紫色
#define BL_COLOR_PURPLE_L(a) [UIColor chColorWithHexString:@"#6B71F5" alpha:a]
#define BL_COLOR_LINEBACKGROUND [UIColor chColorWithHexString:@"#FAFAFB"]  //全局通用浅灰背景色
#define BL_COLOR_BLUE [UIColor chColorWithHexString:@"#6C72F5"]  //全局通用蓝色
#define BL_COLOR_ALPHA [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7]
#define BL_TimeLineCellHighlightedColor [UIColor colorWithRed:92/255.0 green:140/255.0 blue:193/255.0 alpha:1.0]
#define COOKIES_KEY @"THERE_COOKIES"

#define IS_IOS10_2_LATER ([[[UIDevice currentDevice] systemVersion] compare:@"10.2" options:NSNumericSearch] == NSOrderedDescending || [[[UIDevice currentDevice] systemVersion] compare:@"10.2" options:NSNumericSearch] == NSOrderedSame)

#define IS_IOS9() ([[UIDevice currentDevice].systemVersion doubleValue] >= 9.0)
#define IS_IOS11() ([[UIDevice currentDevice].systemVersion doubleValue] >= 11.0)

#define STORE_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

//不需要导航栏的控制器数组
#define NoneNavViewControllers @[@"BLMyController",@"BLMeet_DetailController",@"BLChatController",@"BLMeetController",@"BLBuyVipController"]

#define BLPPDelegate ((AppDelegate*)[[UIApplication sharedApplication] delegate])

//字符串处理
#define BL_STRING(str) (str || str.length > 0)?str:@""
/** int 包装 字符串 */
#define BL_WTAPSTRING(value) [NSString stringWithFormat:@"%ld",(long)value]


#define BLImage(str) [UIImage imageNamed:str]
//空字典
#define BL_EMPTYDIC @{}



//用户相关宏
#define K_Login_Ppu @"K_Login_Ppu"
//用户相关宏
#define K_Login_RegisterStep @"K_Login_RegisterStep"
//用户相关宏
#define K_Login_Phone @"K_Login_Phone"






//通知
//个人信息，基础信息详细信息等和登录相关的数据刷新通知
#define Notification_login @"Notification_login"

#endif /* BLDefineConfig_h */
